<template>
  {{ sys.blog_name }}
  <div class="block">
    <el-avatar :size="100" :src="sys.blog_icon"></el-avatar>
  </div>
  <div class="demo-collapse">
    <el-collapse v-model="activeNames" @change="handleChange">
      <el-collapse-item v-for="(item,index) in custom.Data" :key="index" :title="item.page_name" :name="item.ID">
        <div>
          {{item.content}}
        </div>
      </el-collapse-item>
    </el-collapse>
  </div>
</template>

<script lang="ts">
import {defineComponent, ref} from 'vue';
import request from "@/utils/request";

export default defineComponent({
  name: 'LiftBar',
  //接收父级组件传进来的参数
  props:[
      "sys"
  ],
  setup(){
    let custom = ref({})
    const getAllCustom = () => {
      request.post("custom").then((res:any)=>{
        if (res.code == 200) {
          custom.value = res.data
          console.log(custom.value)
        }
      })
    }
    const activeNames = ref([1])
    const handleChange = () => {
      console.log(111)
    }
    return {
      custom,
      getAllCustom,
      activeNames,
      handleChange
    }
  },
  beforeCreate() {
    this.getAllCustom()
  }
});
</script>

<style>

</style>